home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_9.lha
/
7_9
/
7_9_getn.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
535b
|
35 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Get the next entry from a list,
/ removing it afterwards.
/ curr is left alone.
nt dlist::getnext(dlink *&a)
if (!last)
return 0;
// choose the link to remove
if (curr)
if (curr == last)
{
curr = 0;
return 0;
}
else
a = curr->next;
else
a = last->next;
// remove a from the list
if (a == last)
last = 0;
else
a->remove();
return 1;